<template>
    <div>
        <van-search v-model="search" shape="round" background="#4fc08d" placeholder="请输入搜索关键词" />
        <van-cell-group>
            <van-cell v-for="item in searchdate"  :title="item.goods_name" />
        </van-cell-group>
    </div>
</template>

<script setup>
import { qsearchApi } from '@/api/api'
import { watch, ref } from 'vue'
let search = ref('')
let searchdate = ref([])
setTimeout(()=>{
watch(search, (val) => {
    qsearchApi(val).then(res => {
        console.log(res);
        searchdate.value = res.data.message
    })
})
},1000)


</script>

<style lang="scss" scoped></style>